/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "parentnameusage")
@NamedQueries({
    @NamedQuery(name = "Parentnameusage.findAll", query = "SELECT p FROM Parentnameusage p"),
    @NamedQuery(name = "Parentnameusage.findByIdparentnameusage", query = "SELECT p FROM Parentnameusage p WHERE p.idparentnameusage = :idparentnameusage"),
    @NamedQuery(name = "Parentnameusage.findByParentnameusage", query = "SELECT p FROM Parentnameusage p WHERE p.parentnameusage = :parentnameusage")})
public class Parentnameusage implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idparentnameusage")
    private Integer idparentnameusage;
    @Column(name = "parentnameusage")
    private String parentnameusage;
    @OneToMany(mappedBy = "parentnameusage", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Parentnameusage() {
    }

    public Parentnameusage(Integer idparentnameusage) {
        this.idparentnameusage = idparentnameusage;
    }

    public Parentnameusage(Integer idparentnameusage, String parentnameusage) {
        this.idparentnameusage = idparentnameusage;
        this.parentnameusage = parentnameusage;
    }

    public Integer getIdparentnameusage() {
        return idparentnameusage;
    }

    public void setIdparentnameusage(Integer idparentnameusage) {
        this.idparentnameusage = idparentnameusage;
    }

    public String getParentnameusage() {
        return parentnameusage;
    }

    public void setParentnameusage(String parentnameusage) {
        this.parentnameusage = parentnameusage;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idparentnameusage != null ? idparentnameusage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Parentnameusage)) {
            return false;
        }
        Parentnameusage other = (Parentnameusage) object;
        if ((this.idparentnameusage == null && other.idparentnameusage != null) || (this.idparentnameusage != null && !this.idparentnameusage.equals(other.idparentnameusage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Parentnameusage[idparentnameusage=" + idparentnameusage + "]";
    }

}
